Skip to content

Conversation

@afonja14755
Copy link
Contributor

@afonja14755 afonja14755 commented Aug 8, 2025

Important

Encode username in main.ts when setting GitLab credentials to handle special characters.

  • Behavior:
    • Encode username using encodeURIComponent in main() in main.ts when setting GitLab credentials.
  • Misc:
    • Add changeset file long-stars-tie.md to document the patch fix.

This description was created by Ellipsis for 5d189a5. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of special characters in usernames when setting the Git remote URL, ensuring proper URL encoding.

@changeset-bot
Copy link

changeset-bot bot commented Aug 8, 2025

🦋 Changeset detected

Latest commit: 9d0528e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
changesets-gitlab Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 8, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed everything up to 5d189a5 in 57 seconds. Click for details.
  • Reviewed 32 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .changeset/long-stars-tie.md:5
  • Draft comment:
    Consider adding a more descriptive changeset message for clarity on what was fixed.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. src/main.ts:38
  • Draft comment:
    Using encodeURIComponent for the username is appropriate to handle special characters. Optionally, review if any other credential parts (e.g., GITLAB_TOKEN) might also require encoding.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
3. .changeset/long-stars-tie.md:5
  • Draft comment:
    Typographical suggestion: The commit message on this line is written as "fix encode username". To maintain consistency with conventional commit formatting (as seen in the PR title), consider adding a colon after "fix" (i.e., "fix: encode username").
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This is a changeset file, not a commit message. While conventional commit format is common, there's no strong evidence that this project requires or uses that format for changeset descriptions. The suggestion is more about style than substance, and doesn't affect functionality. The project might have specific formatting requirements for changesets that I'm not aware of. The consistency with PR title format could be important for automated tools. Without clear evidence of required changeset formatting conventions in this project, this appears to be a purely stylistic suggestion that doesn't warrant a comment. Delete this comment as it's making a style suggestion without clear evidence that this format is required or important.

Workflow ID: wflow_nzfXu3eZfzgHjnMQ

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@afonja14755
Copy link
Contributor Author

@JounQin, here is PR for #116

@afonja14755 afonja14755 force-pushed the fix/encode-username branch from 5d189a5 to 54c7dd1 Compare August 8, 2025 11:17
@coderabbitai
Copy link

coderabbitai bot commented Aug 8, 2025

Walkthrough

A changeset file was added to document a patch update addressing a fix for encoding the username in a Git remote URL. In the main source file, the construction of the Git remote URL was updated to encode the username using encodeURIComponent, ensuring proper handling of special characters.

Changes

Cohort / File(s) Change Summary
Changeset Metadata
.changeset/long-stars-tie.md
Added a changeset file describing a patch fix for encoding the username in a URL.
Git Remote URL Encoding
src/main.ts
Updated the Git remote URL construction to encode the username with encodeURIComponent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

A username hops through the URL field,
Special characters once unsealed.
Now encoded with care,
No errors to snare,
This patch ensures secrets are properly concealed!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@afonja14755 afonja14755 force-pushed the fix/encode-username branch from 54c7dd1 to 9d0528e Compare August 8, 2025 11:18
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 8, 2025

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 8, 2025

Open in StackBlitz

npm i https://pkg.pr.new/changesets-gitlab@223

commit: 9d0528e

@JounQin JounQin changed the title fix: encode username fix: encode username in URL Aug 8, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/main.ts (1)

45-47: Optional: build the URL via WHATWG URL API for correctness and readability

Leverage URL.username/password for automatic encoding and simpler construction.

You can refactor this block as:

const remote = new URL(env.GITLAB_HOST)
remote.username = username            // auto-encodes
remote.password = GITLAB_TOKEN        // auto-encodes
remote.pathname = `${remote.pathname.replace(/\/$/, '')}/${env.CI_PROJECT_PATH.split('/').map(encodeURIComponent).join('/')}.git`

await exec('git', ['remote', 'set-url', 'origin', remote.toString()], {
  silent: !TRUTHY_VALUES.has(env.DEBUG_GITLAB_CREDENTIAL!),
})

This avoids manual string concatenation and double-encoding risks.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85b28f7 and 9d0528e.

📒 Files selected for processing (2)
  • .changeset/long-stars-tie.md (1 hunks)
  • src/main.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-01T09:12:22.109Z
Learnt from: JounQin
PR: un-ts/changesets-gitlab#0
File: :0-0
Timestamp: 2025-04-01T09:12:22.109Z
Learning: For the un-ts/changesets-gitlab repository, always run `yarn build` before running `yarn lint` as the build process generates files required by the linting process.

Applied to files:

  • src/main.ts
🧬 Code Graph Analysis (1)
src/main.ts (1)
src/env.ts (1)
  • GITLAB_TOKEN (24-32)
🔇 Additional comments (2)
.changeset/long-stars-tie.md (1)

1-6: Changeset looks good

Clear, scoped patch note matching the code change intent.

src/main.ts (1)

45-45: Good fix: username is now encoded

Using encodeURIComponent for the username in the remote URL is correct and addresses special characters.

@JounQin JounQin merged commit 9ab4bb0 into un-ts:main Aug 8, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants